/*!  \file  Counter.cpp
 *	  \brief  
 * 
 *   \details   details
 *   \author    Yordan Madzhunkov German Research School for Simulation Sciences GmbH
 *   \version   1.0
 *   \date      07/09/2013 10:15:07 AM
 *   \copyright GNU Public License.
 */
#include <pthread.h>
#include "Lock.h"
#include "Counter.h"
#include <assert.h>
Counter::Counter(const int init_val) {
  value = init_val;
}
Counter::~Counter() {}
void Counter::setValue(const int val) {
	lockMe(); value = val; unlockMe(); 
};
int Counter::getValue() {
	lockMe(); int res = value; unlockMe(); 
	return res;
};
Counter & Counter::operator += (const int v) {
	lockMe(); value += v; unlockMe(); 
	return *this;
}
